********************************************************************************
* 	Administrative Designs and Access to Political Arenas in Public Education  *
* 							Replication Data & Package				           * 
********************************************************************************
* Authors: 	Maya Nuñez, Cameron Arnzen, Hannah Rosenstein, Susan Moffitt, 
* 			Johnathan Collins
*
********************************************************************************

*************************** SETTING IT ALL UP **********************************
cap log close
clear all
set more off, perm

version 18.0

* Create Folder for Data Output (Update to your own & Create "Output" folder)
global data "/Users/camarnzen/Library/CloudStorage/GoogleDrive-cameron_arnzen@brown.edu/My Drive/a. Realizing Rights Lab/Venue Democracy/a. Manuscripts/Governance Submission Materials/Harvard Dataverse" // Set to working folder
global output "$data/Output"   
cd "$output"

* Install Relevant Packages
ssc install estout, replace

****************************** ANALYSES *******************************
*This .do file runs the general analyses to test our hypotheses. 

*Unit of Analysis: U.S. School District (N: 11,179)
*	Primary DV: 	School Board Meeting Availability (Online Access)
*	Primary IVs: 	District Info (Size), Urbanicity, Poverty, Partisanship, 
*					Internet Access
*					
*	Method(s): 		Linear Probability Models 
*					(w. Logistic Regression Models in Appendix)

use "$data/data.dta", replace

* TABLE 1: Summary Statistics
eststo summstats: summarize board_meeting_info district_admin_support_staff wl_admin_exp_os turnout sb_elections_on_cycle sb_elections_partisan urban_district suburban_district town_district rural_district operational_schools total_students race_perc_white race_perc_black race_perc_hisp poverty_rate

* TABLE 2: LPM of School Board Information
eststo fin_Model: quietly reg board_meeting_info ln_district_admin_support_staff ln_wl_admin_exp_os votes_student_ratio sb_elections_on_cycle sb_elections_partisan internet_access rural_district urban_district race_perc_black race_perc_hisp poverty_rate, vce(robust)
	estadd local state_fe "NO"
	
eststo fin_Model_fe: quietly reg board_meeting_info ln_district_admin_support_staff ln_wl_admin_exp_os votes_student_ratio sb_elections_on_cycle sb_elections_partisan internet_access rural_district urban_district race_perc_black race_perc_hisp poverty_rate  i.state_fips, vce(robust)
	estadd local state_fe "YES"
	
esttab fin_Model fin_Model_fe using "$output/t_lpm_SBinfo.csv", replace se s(state_fe r2 N, labels("State Fixed Effects" "R-Squared" "N")) drop (*state_fips*  _cons) nogaps label title(Table 2. Linear Probability Model of Digital Board Information) mlabel("OLS" "Fixed Effects") 

* TABLE 3: Summary Statistics for School Disticts 
* Houston Independent
summarize district_admin_support_staff exp_pp turnout vote_share_dem vote_share_rep sb_elections_on_cycle sb_elections_partisan urbanicity total_students race_perc_white race_perc_black race_perc_hisp poverty_rate if leaid_str == "4823640"

* Metro-Nashville Public School Boards
summarize district_admin_support_staff exp_pp turnout vote_share_dem vote_share_rep sb_elections_on_cycle sb_elections_partisan urbanicity total_students race_perc_white race_perc_black race_perc_hisp poverty_rate if leaid_str == "4703180"

* Clay County Public Schools
summarize district_admin_support_staff exp_pp turnout vote_share_dem vote_share_rep sb_elections_on_cycle sb_elections_partisan urbanicity total_students race_perc_white race_perc_black race_perc_hisp poverty_rate if leaid_str == "4700660"

* Overton County Public Schools
summarize district_admin_support_staff exp_pp turnout vote_share_dem vote_share_rep sb_elections_on_cycle sb_elections_partisan urbanicity total_students race_perc_white race_perc_black race_perc_hisp poverty_rate if leaid_str == "4703330"

* ONLINE APPENDIX TABLE 3: LPM SOCIAL MEDIA INFO
eststo sm_1: quietly reg sm_one ln_district_admin_support_staff ln_wl_admin_exp_os votes_student_ratio sb_elections_on_cycle sb_elections_partisan internet_access rural_district urban_district race_perc_black race_perc_hisp poverty_rate  i.state_fips, vce(robust)
	estadd local state_fe "YES"
	
eststo sm_2: quietly reg sm_two ln_district_admin_support_staff ln_wl_admin_exp_os votes_student_ratio sb_elections_on_cycle sb_elections_partisan internet_access rural_district urban_district race_perc_black race_perc_hisp poverty_rate  i.state_fips, vce(robust)
	estadd local state_fe "YES"
	
esttab sm_1 sm_2 using "$output/t_lpm_SMinfo.csv", replace se s(state_fe r2 N, labels("State Fixed Effects" "R-Squared" "N")) drop (*state_fips*  _cons) nogaps label title(Table 3. Linear Probability Models of Social Media Presence) mlabel("Facebook / X" "Facebook & X") 


